From: Tien Hock, Loh Date: Fri, 22 Mar 2019 04:54:31 +0000 (+0800) Subject: driver: synosys: Fix SD MMC not initializing correctly X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=2baa7270111eb25430e860fdeb0cbd220a958a53;p=project%2Fbcm63xx%2Fatf.git driver: synosys: Fix SD MMC not initializing correctly dw_params.mmc_dev_type should be assigned before mmc_init, otherwise SDMMC initialization will fail as the initialization treats the device as EMMC instead of SD. Signed-off-by: Tien Hock, Loh --- diff --git a/drivers/synopsys/emmc/dw_mmc.c b/drivers/synopsys/emmc/dw_mmc.c index 4cd1226a..b0dcaa73 100644 --- a/drivers/synopsys/emmc/dw_mmc.c +++ b/drivers/synopsys/emmc/dw_mmc.c @@ -426,8 +426,7 @@ void dw_mmc_init(dw_mmc_params_t *params, struct mmc_device_info *info) memcpy(&dw_params, params, sizeof(dw_mmc_params_t)); mmio_write_32(dw_params.reg_base + DWMMC_FIFOTH, 0x103ff); + dw_params.mmc_dev_type = info->mmc_dev_type; mmc_init(&dw_mmc_ops, params->clk_rate, params->bus_width, params->flags, info); - - dw_params.mmc_dev_type = info->mmc_dev_type; }